[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
INSTR(SEXP1,SEXP2) (INTEGER)
Function
Find the position of one string within another string.
Syntax
INSTR(str,sub)
str = A string expression to look for sub in.
sub = A string expression to search for.
Return Type & Value
INTEGER
Returns the 1-based position of sub within str or 0 if sub is not
found within str. (1-based means the first character of str is position 1)
Remarks
This function is useful for determining if a particular word or phrase
exists in a string. The return value is the position of the sub string
within the longer string. The first character of str is position 1, the
second is position 2, and so on. If sub is not found in str, 0 is returned.
Examples
STRING s
WHILE (INSTR(UPPER(s),"QUIT") = 0) DO
INPUTTEXT "Enter string",s,@X0E,40
NEWLINE
PRINTLN s
ENDWHILE
See Also:
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson